/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.math.BigDecimal;

/**
 *
 * @author Administrator
 */
public class IndividualAccount extends Account{
    @Override
    public boolean canTransferTo(Account other) {
        if(other.getClass().equals(this.getClass()))
            return true;
        if(other.getClass().equals(VipAccount.class) && other.getOwnerID().equals(this.getOwnerID()))
            return true;
        return false;
            
    }
    
    @Override
    public boolean draw(BigDecimal amount) {
        if(this.getBalance().subtract(amount).compareTo(BigDecimal.ZERO) < 0) {
            return false;
        }        
        return super.draw(amount);
    }
    
}
